<?php
include('includes/header.php');
$titulo = 'Imprimir Informe';
include('menu.php');
$doctor = utf8_encode(GetValue("doctor"));
$matricula1 = utf8_encode(GetValue("matricula1"));
$matricula2 = utf8_encode(GetValue("matricula2"));
?>
<link type="text/css" href="styles/print.css" rel="stylesheet" media="print"/>
<script>
    $(document).ready(function(){
          print();
         
    });    
</script>
</head>
<body>
    <?php
    function isChecked($index)
{
    global $pap;
    if (isset($pap[$index]))
    //return "checked='checked'";
        return "<img src='imagenes/checked.png' width='10' height='10' />";
    return "<img src='imagenes/unchecked.png' width='10' height='10' />";
}

function isCheckedDiag($index)
{
    global $diagnostico;
    if (isset($diagnostico[$index]))
    //return "checked='checked'";
        return "<img src='imagenes/checked.png' width='10' height='10' />";
    return "<img src='imagenes/unchecked.png' width='10' height='10' />";
}

function GetSelected($query)
{
    $result = mysql_query($query);
    if ($result && mysql_num_rows($result) > 0)
    {
        for ($index = 0; $index < mysql_num_rows($result); $index++)
        {
            $ret[mysql_result($result, $index)] = true;
        }
        return $ret;
    }
    else
        return false;
}
    $protocolo = is_numeric($_SESSION["protocolo"]) ? $_SESSION["protocolo"] : 0;
    $query = "select numero_protocolo, id_tipo_informe, id_consultorio 
        from protocolo where numero_protocolo = ".$protocolo;
    $actual = GetSQL($query);
   //DEBUG
    echo '<div id="ocultos">';    
        echo '<div>';
        if ($actual[0]['id_tipo_informe'] == PAP)
        {
            include("impresionPap.php");
        } else
        {
            include("impresionBiopsia.php");
        }
        echo '</div>'; 
        include ('pieInforme.php');
    echo '</div>';
    echo '<div class="no-print">Imprimiendo protocolo ' . $protocolo . '</div>';
    ?>
</body>
</html>
